const {ethers } = require('ethers');
const config = require('./config');
const { stringToPath } = require("@cosmjs/crypto")

const { DirectSecp256k1HdWallet } = require("@cosmjs/proto-signing")

const words = config.words;

let eth_caller_wallet = ethers.Wallet.fromMnemonic(words);

const fn_noble_caller = async ()=>{
    const mnemonic = config.words;
    const wallet1 = await DirectSecp256k1HdWallet.fromMnemonic(
        mnemonic,
        {
            hdPaths: [stringToPath(config.noble.accounts.caller.hdPaths)],
            prefix: "noble"
        }
    );
    return wallet1;


}
const fn_noble_receipter = async ()=>{
    const mnemonic = config.words;
    const wallet1 = await DirectSecp256k1HdWallet.fromMnemonic(
        mnemonic,
        {
            hdPaths: [stringToPath(config.noble.accounts.receipter.hdPaths)],
            prefix: "noble"
        }
    );

    return wallet1;

}




module.exports = {
    eth_caller_wallet,
    fn_noble_caller,
    fn_noble_receipter
}
